import request from '@/utils/request'
import { listVo } from '../type'

const T = '/system'

/**
 * 列表VO
 */
export interface RowVO {
  id?: number | string
  modelName: string
  modelCode: string
  modelType: string
  modelTypeId: number
  warehouseId: number
  warehouseName: string
}

/**
 * 列表
 * @param {*} params
 * @returns
 */
export function GetListAPI(params: listVo) {
  return request({
    url: T + '/modeling/list',
    method: 'GET',
    params,
  })
}

/**
 * 新增
 * @param {*} data
 * @returns
 */
export function AddDataAPI(data: RowVO) {
  return request({
    url: T + '/modeling',
    method: 'POST',
    data,
  })
}

/**
 * 修改
 * @param {*} data
 * @returns
 */
export function EditDataAPI(data: RowVO) {
  return request({
    url: T + '/modeling',
    method: 'PUT',
    data,
  })
}

/**
 * 删除
 * @param id
 * @returns
 */
export function DelDataAPI(id: string) {
  return request({
    url: T + '/modeling/' + id,
    method: 'DELETE',
  })
}

/**
 * 详情
 * @param id
 * @returns
 */
export function GetDataAPI(id: string) {
  return request({
    url: '/system/modeling/' + id,
    method: 'GET',
  })
}
